main function
If kruskal.test p-value is <0.05, then need to do pairwise wilcoxon rank sum tests.
If you want to do troubleshooting, and not run all the countries/genotypes, then change eval to FALSE.
national_cases <- read_in_national_case_numbers(national_cases_handle, countries_to_include)
#View(national_cases)
restrictions <- read_in_restrictions(restrictions_handle, countries_to_include)
run_main <- function(per_sample_intro_handle, country_iso, n_cases, restrictions, threshold_for_plotting){
#print(per_sample_intro_handle)
#print(country_iso)
per_sample_output <- read_in_per_sample_intros(per_sample_intro_handle, threshold_for_plotting)
per_sample_intros <- per_sample_output$per_sample_intros
vocs_to_plot <- per_sample_output$vocs_to_plot
#View(per_sample_output)
distinct_intros <- distinct(per_sample_intros, introduction_node, .keep_all = TRUE)
plot_size_distribution_by_VOC(distinct_intros, country_iso)
basic_stats_on_distinct_intros(distinct_intros)
print(kruskal.test(cluster_size ~ voc_for_plots, data = distinct_intros))
#View(n_cases)
make_overall_plots(per_sample_intros, n_cases, restrictions, country_iso)
lapply(vocs_to_plot, make_per_VOC_plots, per_sample_intros = per_sample_intros, national_cases = n_cases, restrictions = restrictions, country_iso = country_iso)
}
#countries_to_plot <- c("MWI", "KEN")
#per_sample_intro_handles <- c("/Users/flashton/Dropbox/COVID/AAP_introductions/results/2022.12.02/malawian_introductions.excl_mwi_dups.txt", "/Users/flashton/Dropbox/COVID/AAP_introductions/results/2022.12.02/kenyan_introductions.txt")
countries_to_include <- c("MWI", "KEN", "ZAF", "VNM", "THA", "IDN", "KHM", "LAO")
#run_main("/Users/flashton/Dropbox/COVID/AAP_introductions/results/2022.12.02/cambodian_introductions.txt", "KHM", n_cases = national_cases, restrictions = restrictions, threshold_for_plotting = threshold_for_plotting)
#run_main("/Users/flashton/Dropbox/COVID/AAP_introductions/results/2022.12.02/indonesian_introductions.txt", "IDN", n_cases = national_cases, restrictions = restrictions, threshold_for_plotting = threshold_for_plotting)
#run_main("/Users/flashton/Dropbox/COVID/AAP_introductions/results/2022.12.02/kenyan_introductions.txt", "KEN", n_cases = national_cases, restrictions = restrictions, threshold_for_plotting = threshold_for_plotting)
#run_main("/Users/flashton/Dropbox/COVID/AAP_introductions/results/2022.12.02/laos_introductions.txt", "LAO", n_cases = national_cases, restrictions = restrictions, threshold_for_plotting = threshold_for_plotting)
run_main("/Users/flashton/Dropbox/COVID/AAP_introductions/results/2022.12.02/malawian_introductions.excl_mwi_dups.txt", country_iso = "MWI", n_cases = national_cases, restrictions = restrictions, threshold_for_plotting = threshold_for_plotting)
##
## Kruskal-Wallis rank sum test
##
## data: cluster_size by voc_for_plots
## Kruskal-Wallis chi-squared = 6.6506, df = 4, p-value = 0.1555
## [[1]]
##
## [[2]]
##
## [[3]]
##
## [[4]]
#run_main("/Users/flashton/Dropbox/COVID/AAP_introductions/results/2022.12.02/southafrican_introductions.txt", "ZAF", n_cases = national_cases, restrictions = restrictions, threshold_for_plotting = threshold_for_plotting)
#run_main("/Users/flashton/Dropbox/COVID/AAP_introductions/results/2022.12.02/thai_introductions.txt", "THA", n_cases = national_cases, restrictions = restrictions, threshold_for_plotting = threshold_for_plotting)
#run_main("/Users/flashton/Dropbox/COVID/AAP_introductions/results/2022.12.02/vietnamese_introductions.txt", "VNM", n_cases = national_cases, restrictions = restrictions, threshold_for_plotting = threshold_for_plotting)